<?php

/**
 * This is the model class for table "t_register".
 *
 * The followings are the available columns in table 't_register':
 * @property string $REGISTER
 * @property string $NONPLN
 * @property string $KDVALAS
 * @property string $PAGU
 * @property string $TGLNPLN
 * @property string $KDDONOR
 * @property string $KDKREDITOR
 * @property string $NMDONOR
 * @property string $JMLPNRK
 * @property string $CLOSINGDAT
 * @property string $STATUS
 * @property string $KDUPDATE
 * @property string $UPDATER
 * @property string $TGLUPDATE
 * @property string $_NullFlags
 * @property integer $ID
 */
class TRegister extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return TRegister the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 't_register';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('REGISTER', 'length', 'max'=>8),
			array('NONPLN', 'length', 'max'=>20),
			array('KDVALAS, KDDONOR, KDKREDITOR', 'length', 'max'=>3),
			array('NMDONOR', 'length', 'max'=>25),
			array('STATUS, KDUPDATE', 'length', 'max'=>1),
			array('UPDATER', 'length', 'max'=>50),
			array('PAGU, TGLNPLN, JMLPNRK, CLOSINGDAT, TGLUPDATE, _NullFlags', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('REGISTER, NONPLN, KDVALAS, PAGU, TGLNPLN, KDDONOR, KDKREDITOR, NMDONOR, JMLPNRK, CLOSINGDAT, STATUS, KDUPDATE, UPDATER, TGLUPDATE, _NullFlags, ID', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'REGISTER' => 'Register',
			'NONPLN' => 'Nonpln',
			'KDVALAS' => 'Kdvalas',
			'PAGU' => 'Pagu',
			'TGLNPLN' => 'Tglnpln',
			'KDDONOR' => 'Kddonor',
			'KDKREDITOR' => 'Kdkreditor',
			'NMDONOR' => 'Nmdonor',
			'JMLPNRK' => 'Jmlpnrk',
			'CLOSINGDAT' => 'Closingdat',
			'STATUS' => 'Status',
			'KDUPDATE' => 'Kdupdate',
			'UPDATER' => 'Updater',
			'TGLUPDATE' => 'Tglupdate',
			'_NullFlags' => 'Null Flags',
			'ID' => 'ID',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('REGISTER',$this->REGISTER,true);
		$criteria->compare('NONPLN',$this->NONPLN,true);
		$criteria->compare('KDVALAS',$this->KDVALAS,true);
		$criteria->compare('PAGU',$this->PAGU,true);
		$criteria->compare('TGLNPLN',$this->TGLNPLN,true);
		$criteria->compare('KDDONOR',$this->KDDONOR,true);
		$criteria->compare('KDKREDITOR',$this->KDKREDITOR,true);
		$criteria->compare('NMDONOR',$this->NMDONOR,true);
		$criteria->compare('JMLPNRK',$this->JMLPNRK,true);
		$criteria->compare('CLOSINGDAT',$this->CLOSINGDAT,true);
		$criteria->compare('STATUS',$this->STATUS,true);
		$criteria->compare('KDUPDATE',$this->KDUPDATE,true);
		$criteria->compare('UPDATER',$this->UPDATER,true);
		$criteria->compare('TGLUPDATE',$this->TGLUPDATE,true);
		$criteria->compare('_NullFlags',$this->_NullFlags,true);
		$criteria->compare('ID',$this->ID);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}